package chapter02

import java.io.{File, PrintWriter}

import scala.io.Source

/**
  * create by unseRdoG on  2021-05-28  12:08
  */
object Test06_FileIO {

  def main(args: Array[String]): Unit = {
    // 从文件中读取数据

    Source.fromFile("F:\\学习代码\\尚硅谷\\大数据\\scala\\scala_tutorial\\src\\main\\resources\\test.txt").foreach(print)


    // 将数据写进文件
    val writer = new PrintWriter(new File("F:\\学习代码\\尚硅谷\\大数据\\scala\\scala_tutorial\\src\\main\\resources\\out.txt"))
    writer.write("this is write info")
    writer.close()
  }

}
